<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>物流添加</title>
    <link rel="stylesheet" href="./layui/css/layui.css">
</head>
<body>

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>物流添加</legend>
</fieldset>
<!--面板-->
<div class="layui-card">
    <div class="layui-card-header"></div>
    <div class="layui-card-body">
        <!--    表单-->
        <form class="layui-form" action="">
            <div class="layui-form-item">
                <label class="layui-form-label">订单编号</label>
                <div class="layui-input-block">
                    <input type="text" name="orderId" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">操作名称</label>
                <div class="layui-input-block">
                    <select name="operation">
                        <option value="">请选择</option>
                        <option value="已取件">已取件</option>
                        <option value="正在揽收">正在揽收</option>
                        <option value="运送中">运送中</option>
                        <option value="派送中">派送中</option>
                        <option value="已签收">已签收</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">操作员</label>
                <div class="layui-input-block">
                    <input type="text" name="operator" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">操作员电话</label>
                <div class="layui-input-block">
                    <input type="text" name="phone" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">操作地址</label>
                <div class="layui-input-block">
                    <input type="text" name="address" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">详细信息</label>
                <div class="layui-input-block">
                    <input type="text" name="details" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formDemo">提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>

<script src="./layui/layui.js"></script>
<script src="./js/jquery-3.6.4.min.js"></script>
<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function(data){
            $.ajax({
                url:"/order/update",
                type:"POST",
                data:data.field,
                dataType:"text",
                success:function (result) {
                    layui.layer.msg(result);
                }

            })
            return false;
        });
    });
</script>
</body>
</html>